package com.johnson.news.model.bean;

import android.os.Parcel;
import android.os.Parcelable;

import com.youmbe.library.data.BaseData;

import java.io.Serializable;

public class NewsItem extends BaseData implements Parcelable, Serializable {

	 
	String itemid;
	String catid;
	String title;
	public String thumb;
	String syxhpic;
	String hits;
	String copyfrom;
	String addtime;
	String istoppic;
	String alt;
	String mid;
	String link;
	String catname;
	String istopname;
	
	public NewsItem() { 
		// TODO Auto-generated constructor stub
	}
	
	public String getItemid() {
		return itemid;
	}
	public void setItemid(String itemid) {
		this.itemid = itemid;
	}
	public String getCatid() {
		return catid;
	}
	public void setCatid(String catid) {
		this.catid = catid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getThumb() {
		return thumb;
	}
	public void setThumb(String thumb) {
		this.thumb = thumb;
	}
	public String getSyxhpic() {
		return syxhpic;
	}
	public void setSyxhpic(String syxhpic) {
		this.syxhpic = syxhpic;
	}
	public String getHits() {
		return hits;
	}
	public void setHits(String hits) {
		this.hits = hits;
	}
	public String getCopyfrom() {
		return copyfrom;
	}
	public void setCopyfrom(String copyfrom) {
		this.copyfrom = copyfrom;
	}
	public String getAddtime() {
		return addtime;
	}
	public void setAddtime(String addtime) {
		this.addtime = addtime;
	}
	public String getIstoppic() {
		return istoppic;
	}
	public void setIstoppic(String istoppic) {
		this.istoppic = istoppic;
	}
	public String getAlt() {
		return alt;
	}
	public void setAlt(String alt) {
		this.alt = alt;
	}
	public String getMid() {
		return mid;
	}
	public void setMid(String mid) {
		this.mid = mid;
	}
	public String getLink() {
		return link;
	}
	public void setLink(String link) {
		this.link = link;
	}
	public String getCatname() {
		return catname;
	}
	public void setCatname(String catname) {
		this.catname = catname;
	}
	
	
	public String getIstopname() {
		return istopname;
	}

	public void setIstopname(String istopname) {
		this.istopname = istopname;
	}

	@Override
	public String toString() {
		return "NewsItem [itemid=" + itemid + ", catid=" + catid + ", title="
				+ title + ", thumb=" + thumb + ", syxhpic=" + syxhpic
				+ ", hits=" + hits + ", copyfrom=" + copyfrom + ", addtime="
				+ addtime + ", istoppic=" + istoppic + ", alt=" + alt
				+ ", mid=" + mid + ", link=" + link + ", catname=" + catname+",istopname="+istopname
				+ "]";
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel parcel, int arg1) {
    	
		// TODO Auto-generated method stub
		parcel.writeString(itemid);    
        parcel.writeString(catid);    
        parcel.writeString(title);    
        parcel.writeString(thumb);    
        parcel.writeString(syxhpic);    
        parcel.writeString(hits); 
        parcel.writeString(copyfrom);    
        parcel.writeString(addtime);    
        parcel.writeString(istoppic);
        parcel.writeString(alt);    
        parcel.writeString(mid);    
        parcel.writeString(link); 
        parcel.writeString(catname); 
	}
	
	
	public static final Parcelable.Creator<NewsItem> CREATOR = new Creator<NewsItem>() {
        public NewsItem createFromParcel(Parcel source) {
            //这里一定要注意，这里的顺序一定要不要搞错了．不然取不出来值，为这个我头痛了二个小时  
            //如果有boolean类型的数据，在这里就得传为数值型，然后再转回去  
        	NewsItem item = new NewsItem(); 
        	item.itemid = source.readString();
        	item.catid = source.readString();
        	item.title = source.readString();
        	item.thumb = source.readString();
        	item.syxhpic = source.readString();
        	item.hits = source.readString();
        	item.copyfrom = source.readString();
        	item.addtime = source.readString();
        	item.istoppic = source.readString();
        	item.alt = source.readString();
        	item.mid = source.readString();
        	item.link = source.readString();
        	item.catname = source.readString();
            return item;    
        }    
        public NewsItem[] newArray(int size) {    
            return new NewsItem[size];    
        }    
    };
	
}
